<? if ($c = stack('name')) {

	$s = component_settings($c);
	$d = component_data($c); 
	
?><script type="text/javascript">jQuery(function($) {
	$("#footer").before($("#cat-<?=$c?>-overlay"));

	$("#cpn-<?=$c?> .gallery a").overlay({ 
		 target: '#cpn-<?=$c?>-overlay', 
		 expose: {color:"#000", opacity:0.6},
		 loadSpeed: 300
	}).gallery({ 
		 speed: 300 
	});


});</script><?

//debug($s);
//debug($d);

	?><div id="cpn-<?=$c?>" class="catalog-item"><?

		?><h1 class="title"><?=$d['title']?></h1><?
		
		?><div class="images"><?
	
		if ($im = $d['image']) {
			?><img src="<?=$im['fn']?>" width="<?=$im['x']?>" height="<?=$im['y']?>" class="large-image" alt="<?=h($d['title'])?>" /><?
		}

		?><div class="buttons">
			<div class="g-to-left"><a href="#" class="g-button-scaled g-button-oo cartAdd" title="Добавить в корзину"><span class="rt"></span>Добавить в корзину</a></div>
			<div class="g-to-right"><a href="/contact/" class="g-button-scaled g-button-go" title="Индивидуальный заказ"><span class="rt"></span>Индивидуальный заказ</a></div>
			<div class="clearer"></div>
		</div><?
		
		if (sizeof($g = $d['gallery'])) {
			?><div class="gallery"><div class="items"><?
			
			foreach($g as $im) {
			
				?><a href="<?=$im['fn']?>" title="<?=h($im['descr'] ? "$im[descr] ($d[title])" : $d['title'])?>" class="gallery-link">
					<img src="<?=$im['tn']?>" width="<?=$im['tnw']?>" height="<?=$im['tnh']?>" class="gallery-tn" alt="<?=h($im['descr'] ? "$im[descr] ($d[title])" : $d['title'])?>" />
				</a><?
			
			}
			
			?></div></div><?
		}
		
		?></div><?

		?><div class="body"><?=$d['body']?></div><?
	
		?><div class="clearer"></div><?
		
	?></div><?

	?><div class="simple_overlay" id="cpn-<?=$c?>-overlay"> 
		 <!-- "previous image" action --> 
		 <a class="prev">&lt;</a> 
	 
		 <!-- "next image" action --> 
		 <a class="next">&gt;</a> 
	 
		 <!-- image information --> 
		 <div style="display:none"><div class="info"></div></div>
	 
		 <!-- load indicator (animated gif) --> 
		 <img class="progress" src="/img/jqt/loading.gif" /> 
	</div><?
	
	unstack();
} ?>